<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="common/common.html::common_css">
</head>
<style>
    p {
        margin-left: 5px;
    }

    .l {
        margin-left: 30%;
    }

    span p {
        margin-left: 0;
    }
</style>
<body>
<div class="page" style="width: 100%;background:url('/static/img/bg/3.jpg') center center;background-size: cover" >
    <div th:replace="common/common.html::common_navbar"></div>
    <!-- Breadcrumb-->
    <div class="breadcrumb-holder">
        <div class="container-fluid">
            <ul class="breadcrumb">
                <li class="breadcrumb-item"><a th:href="@{/student/student_index.html}">主页</a></li>
                <li class="breadcrumb-item"><a th:href="@{/student/finishexam.html}">查看成绩信息</a></li>
                <li class="breadcrumb-item active">考试结果</li>
            </ul>
        </div>
    </div>
    <section>
        <div class="container-fluid">
            <!-- Page Header-->
            <header>
                <h1 class="h3 display">成绩详情</h1>
            </header>
            <div class="row">
                <div class="col-lg-6" style="flex:100%;max-width: 100%">
                    <div class="form-group-material" style="text-align: center">
                        <label for="testpapername" class="label-material">试卷名称</label>
                        <p id="testpapername" th:text="${testpaper.testpapername}" type="text"
                           class="input-material"></p>
                    </div>
                    <div class="form-group-material" style="text-align: center">
                        <span>
                        <label class="label-material"
                               style="color: #aaaaaa;">部门</label>
                        <p th:text="${testpaper.apartmentname}"></p>
                        </span>
                        <!--                    </div>-->
                        <!--                    <div class="form-group-material" style="text-align: center">-->
                        <span>
                        <label class="label-material"
                               style="color: #aaaaaa;">试卷类型</label>
                        <p th:if="${testpaper.type}">固定组卷</p>
                        <p th:if="${not testpaper.type}">随机组卷</p>
                        </span>
                    </div>
                    <div class="form-group-material" style="text-align: center">
                        <span>
                        <label class="label-material"
                               style="color: #aaaaaa;">单选题数目</label>
                        <p th:text="${Squestions.size()}"></p>
                        </span>
                        <span>
                        <label class="label-material"
                               style="color: #aaaaaa;">多选题数目</label>
                        <p th:text="${Mquestions.size()}"></p>
                        </span>
                        <span>
                        <label class="label-material"
                               style="color: #aaaaaa;">判断题数目</label>
                        <p th:text="${Jquestions.size()}"></p>
                        </span>
                    </div>
                    <div class="form-group-material" style="text-align: center">
                        <span>
                        <label class="label-material"
                               style="color: #aaaaaa;">得分</label>
                        <p th:text="${testpaper.score}+'/'+${testpaper.totalscore}"></p>
                            </span>
                        <span>
                            <label class="label-material"
                                   style="color: #aaaaaa;">状态</label>
                            <p th:if="${(testpaper.score*1.0)/(testpaper.totalscore*1.0) < 0.6}" style="color: red">不及格</p>
                            <p th:if="${(testpaper.score*1.0)/(testpaper.totalscore*1.0) >= 0.6 and (testpaper.score*1.0)/(testpaper.totalscore*1.0) < 0.8}"
                               style="color: darkorange">及格</p>
                            <p th:if="${(testpaper.score*1.0)/(testpaper.totalscore*1.0) >= 0.8 and (testpaper.score*1.0)/(testpaper.totalscore*1.0) < 0.9}"
                               style="color: greenyellow">良好</p>
                            <p th:if="${(testpaper.score*1.0)/(testpaper.totalscore*1.0) >= 0.9}" style="color: limegreen">优秀</p>
                            </span>
                    </div>
                    <div class="form-group-material">
                        <h4 class="label-material l"
                            style="color: #aaaaaa;">试卷内容</h4>
                        <table class="table">
                            <tbody>
                            <th:block th:if="${Squestions.size() != 0}">
                                <tr>
                                    <td>
                                        <h5 class="label-material l">单 选 题</h5>
                                    </td>
                                </tr>
                                <tr th:each="question,Stat:${Squestions}">
                                    <td>
                                        <div class="form-group-material l">
                                            <label class="label-material" th:text="${question.content}"></label>
                                            <p th:if="${(question.optionA!= null and (not question.optionA.equals('')))}">
                                                A <span th:text="${question.optionA}"></span></p>
                                            <p th:if="${(question.optionB!= null and (not question.optionB.equals('')))}">
                                                B <span th:text="${question.optionB}"></span></p>
                                            <p th:if="${(question.optionC!= null and (not question.optionC.equals('')))}">
                                                C <span th:text="${question.optionC}"></span></p>
                                            <p th:if="${(question.optionD!= null and (not question.optionD.equals('')))}">
                                                D <span th:text="${question.optionD}"></span></p>
                                            <p th:if="${(question.optionE!= null and (not question.optionE.equals('')))}">
                                                E <span th:text="${question.optionE}"></span></p>
                                            <p th:if="${(question.optionF!= null and (not question.optionF.equals('')))}">
                                                F <span th:text="${question.optionF}"></span></p>
                                        </div>
                                        <div class="form-group-material l">
                                            <p th:text="'标准答案: '+${question.answer}"></p>
                                            <p style="color: #22be34" th:text="'你的答案: '+${Sanswers[Stat.index]}">
                                            <p th:if="${question.answer eq Sanswers[Stat.index]}"
                                               th:text="'得分: '+${question.point}">
                                            <p th:if="${question.answer ne Sanswers[Stat.index]}">得分: 0</p>
                                        </div>
                                    </td>
                                </tr>
                            </th:block>
                            <th:block th:if="${Mquestions.size() != 0}">
                                <tr>
                                    <td>
                                        <h5 class="label-material l">多 选 题</h5>
                                    </td>
                                </tr>
                                <tr th:each="question,Stat:${Mquestions}">
                                    <td>
                                        <div class="form-group-material l">
                                            <label class="label-material" th:text="${question.content}"></label>
                                            <p th:if="${(question.optionA!= null and (not question.optionA.equals('')))}">
                                                A <span th:text="${question.optionA}"></span></p>
                                            <p th:if="${(question.optionB!= null and (not question.optionB.equals('')))}">
                                                B <span th:text="${question.optionB}"></span></p>
                                            <p th:if="${(question.optionC!= null and (not question.optionC.equals('')))}">
                                                C <span th:text="${question.optionC}"></span></p>
                                            <p th:if="${(question.optionD!= null and (not question.optionD.equals('')))}">
                                                D <span th:text="${question.optionD}"></span></p>
                                            <p th:if="${(question.optionE!= null and (not question.optionE.equals('')))}">
                                                E <span th:text="${question.optionE}"></span></p>
                                            <p th:if="${(question.optionF!= null and (not question.optionF.equals('')))}">
                                                F <span th:text="${question.optionF}"></span></p>
                                        </div>
                                        <div class="form-group-material l">
                                            <p th:text="'标准答案: '+${question.answer}"></p>
                                            <p style="color: #22be34" th:text="'你的答案: '+${Manswers[Stat.index]}">
                                            <p th:if="${question.answer eq Manswers[Stat.index]}"
                                               th:text="'得分: '+${question.point}">
                                            <p th:if="${question.answer ne Manswers[Stat.index]}">得分: 0</p>
                                        </div>
                                    </td>
                                </tr>
                            </th:block>
                            <th:block th:if="${Jquestions.size()!=0}">
                                <tr>
                                    <td>
                                        <h5 class="label-material l">判 断 题</h5>
                                    </td>
                                </tr>
                                <tr th:each="question,Stat:${Jquestions}">
                                    <td>
                                        <div class="form-group-material l">
                                            <label class="label-material" th:text="${question.content}"></label>
                                            <p th:if="${question.judgeanswer}">标准答案: 正 确</p>
                                            <p th:if="${not question.judgeanswer}">标准答案: 错 误</p>
                                            <p style="color: #22be34" th:if="${Janswers[Stat.index] eq '1'}">你的答案: 正
                                                确</p>
                                            <p style="color: #22be34" th:if="${Janswers[Stat.index] eq '0'}">你的答案: 错
                                                误</p>
                                            <p th:if="${(question.judgeanswer and (Janswers[Stat.index] eq '1'))or(not question.judgeanswer and (Janswers[Stat.index] eq '0'))}"
                                               th:text="'得分: '+${question.point}">
                                            <p th:if="${(question.judgeanswer and (Janswers[Stat.index] eq '0'))or(not question.judgeanswer and (Janswers[Stat.index] eq '1'))}">得分: 0</p>
                                        </div>
                                    </td>
                                </tr>
                            </th:block>
                            </tbody>
                        </table>
                    </div>
                    <div class="form-group text-center">
                        <a th:href="@{/student/finishexam.html}"
                           type="button" class="btn btn-warning m-b-10 m-1-5"
                           style="border-radius: 4px;margin-left: 50px">返回</a>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <div th:replace="common/common.html::common_footer"></div>
</div>
<div th:replace="common/common.html::common_js">
</div>
</body>
</html>